/*
 * FlightController_StickCmd.h
 *
 *  Created on: Jan 21, 2014
 *      Author: ppks
 */

#ifndef FLIGHTCONTROLLER_STICKCMD_H_
#define FLIGHTCONTROLLER_STICKCMD_H_

/********************************************************************************/
/* Constants Definition                                                         */
/********************************************************************************/
/* RC functions */
#define ROL_LO      (1 << (2 * ROLL))
#define ROL_CE      (3 << (2 * ROLL))
#define ROL_HI      (2 << (2 * ROLL))
#define PIT_LO      (1 << (2 * PITCH))
#define PIT_CE      (3 << (2 * PITCH))
#define PIT_HI      (2 << (2 * PITCH))
#define YAW_LO      (1 << (2 * YAW))
#define YAW_CE      (3 << (2 * YAW))
#define YAW_HI      (2 << (2 * YAW))
#define THR_LO      (1 << (2 * THROTTLE))
#define THR_CE      (3 << (2 * THROTTLE))
#define THR_HI      (2 << (2 * THROTTLE))

#define NUMBER_OF_AUX_CHANNELS      4
#define RC_DELAY_COUNTER_LIMIT      250
#define RC_COMMAND_DELAY_CYCLES     20

/* Following defines are used when standard AUX mode is used L M H */
#define AUX_CHANNEL_1_3_VALUE       1300
#define AUX_CHANNEL_2_3_VALUE       1700

/* Following defines are used if EXTENDED_AUX_STATES is enabled */
#define AUX_CHANNEL_1_6_VALUE       1230
#define AUX_CHANNEL_2_6_VALUE       1360
#define AUX_CHANNEL_3_6_VALUE       1490
#define AUX_CHANNEL_4_6_VALUE       1620
#define AUX_CHANNEL_5_6_VALUE       1750

/********************************************************************************/
/* Exported Variables Declaration                                               */
/********************************************************************************/
extern uint8_t rcOptions[];

/********************************************************************************/
/* Exported Functions Prototypes                                                */
/********************************************************************************/
extern void FlightController_StickCommandHandler(void);

#endif /* FLIGHTCONTROLLER_STICKCMD_H_ */
